<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Tìm kiếm</title>
</head>
<body bottomMargin=0 leftMargin=0
topMargin=0 rightMargin=0>
	<TABLE width="1024" height="768" border=0 cellSpacing=0 cellPadding=0 align=center>
	<TR HEIGHT="150">
	<TD Align=center colspan=5>
	<%@include file="top.jsp"%>
	</TD>
	</TR>
	
	<!---Khai báo khoảng phân cách--->
	<TR HEIGHT="2">
	<TD colspan=5 bgcolor="white"></TD>
	</TR>
	
	<TR HEIGHT=100%>
	<TD vAlign="top" width="150">
	<%@include file="left.jsp"%>
	</TD>
	
	<!---Khai báo khoảng phân cách--->
	<TD bgcolor=white width="2"></TD>
	<TD vAlign=top width="720" bgcolor=#C8DBDE>
<SCRIPT language=JavaScript>
function checkinput()
{
	if(document.frmView.word.value=="" && document.frmView.subject.value=="" && document.frmView.name.value=="" && document.frmView.author.value=="" && document.frmView.publish.value=="" && document.frmView.ISBN.value=="")
	{
		alert("Xin vui lòng nhập từ khóa/tên máy/hãng sản xuất/giá");
		document.frmView.word.focus();
		return false;
	}
	return true;
}
</SCRIPT>
<form action="result_by_room_name.jsp" method="POST" name="frmView" onsubmit="return checkinput();">
	<table width="100%" border="0" cellspacing="3" cellpadding="3" align=center>
	<tr>
	<td colspan="2" ><b>
	<font face="Arial">Xin vui lòng cung cấp thông tin tìm kiếm<br>
	</font></b></td>
	</tr>
	
<!-- 	<tr> -->
<!-- 	<td width="30%"><font face="Arial">Tên máy:</font></td> -->
<!-- 	<td width="70%"><font face="Arial"></font> -->
<!-- 	<input name="name" id="1" class=text size="30"> -->
<!-- 	</td> -->
<!-- 	</tr> -->
	
	<tr>
	<td width=30%><font face="Arial">Số CMND</font></td>
	<td width=70%><font face="Arial"></font>
		<select name="customer_card">
			
			<%
			Class.forName("com.mysql.jdbc.Driver");
			Connection con = null;
			Statement smt = null;
			ResultSet rst = null;
			
			String username = "root";
			String password = "Vietyeutam1112";
			String room_id = request.getParameter("room_id");
// 			String buyOK = request.getParameter("buy");
// 			System.out.println(buyOK);
			String url = "jdbc:mysql://127.0.0.1:3306/ghmotel";
			con = DriverManager.getConnection(url, username, password);
			System.out.println("Da ket noi CSDL");
			smt = con.createStatement();
			rst = smt.executeQuery("SELECT * FROM customer");
			
			while (rst.next()){
				out.println("<option value="+rst.getString(1)+">"+rst.getString(1)+":"+rst.getString(2)+"</option>");
			}
			
			%>
		</select>
	</td>
	</tr>
	
	<tr>
	<td width=30%><font face="Arial">Ngày từ:</font></td>
	<td width=40%><font face="Arial"></font>
		<input name=in_date type=text size=50 value='2014-01-01 00:00:00'>
	</td> </tr>
	<tr>
	<td width=30%><font face="Arial">Đến ngày:</font></td>
	<td><input name=out_date type=text size=50 value='2014-01-01 00:00:00'></td>
	</tr>
	
	<tr align="left">
	<td height="51"> </td><td>
	<input type=submit value="Tìm kiếm">
	<input type=reset value="Hủy">
	<input type=hidden name= "Searchfrom" value="CB">
	</td>
	</tr>
	</table>
</form>
	</TD>
	
	<!---Khai báo khoảng phân cách--->
	<TD bgcolor=white width="2"></TD>
	<TD vAlign=top width="150">
	<%@include file="right.jsp"%>
	</TD>
	</TR>
	
	<!---Khai báo khoảng phân cách--->
	<TR HEIGHT="2">
	<TD colspan=5 bgcolor=white></TD>
	</TR>
	
	<TR HEIGHT="50">
	<TD colspan=5 align=center>
	<%@include file="bottom.jsp"%>
	</TD>
	</TR>
	</TABLE>
</body>
</html>